package com.qg.service;

import cn.dm.mapper.DmAreaMapper;
import cn.dm.pojo.DmArea;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class BaseService {
    @Resource
    private DmAreaMapper dmAreaMapper;

    @RequestMapping(value = "/getDmAreById",method = RequestMethod.POST)
    public DmArea getDmAreaById(@RequestParam("id") Long id)throws Exception{
       return dmAreaMapper.getDmAreaById(id);
    }

    @RequestMapping(value = "/getDmAreaListByMap",method = RequestMethod.POST)
    public List<DmArea> getDmAreaListByMap(@RequestBody Map<String,Object> param)throws Exception{
        return dmAreaMapper.getDmAreaListByMap(param);
    }

    @RequestMapping(value = "/getDmAreaCountByMap",method = RequestMethod.POST)
    public Integer getDmAreaCountByMap(@RequestBody Map<String,Object> param)throws Exception{
        return dmAreaMapper.getDmAreaCountByMap(param);
    }

    @RequestMapping(value = "/qdtxAddDmArea",method = RequestMethod.POST)
    public Integer qdtxAddDmArea(@RequestBody DmArea dmArea)throws Exception{
        return dmAreaMapper.insertDmArea(dmArea);
    }

    @RequestMapping(value = "/qdtxModifyDmArea",method = RequestMethod.POST)
    public Integer qdtxModifyDmArea(@RequestBody DmArea dmArea)throws Exception{
        return dmAreaMapper.updateDmArea(dmArea);
    }
}
